import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.12

Item {
    id:root
    width: 800
    height: 480
    property real minSize: Math.min(width/800, height/480)

    Flickable {
        id: flickable
        interactive: false
        anchors.fill: parent
        contentWidth: ts2.x+p7t_toobarHeader.tsInterval*2*11
        ScrollBar.horizontal:ScrollBar {
            parent: flickable
            height: 25
            anchors.bottom: parent.bottom
            minimumSize: 0.2
        }

        Rectangle
        {
            id:p7t_toobarHeader
            height: 40
            width:parent.width
            radius: height/4
            color: "#bb5ed8b8"
            property int textSize:15
            property int tsInterval: 65

            Label {
                id:label_date
                text: qsTr("日期")
                anchors.right: ts1.left
                anchors.left: parent.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                color: "#000000"
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter

            }
            ToolSeparator {
                id:ts1
                x:110
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton //只处理鼠标左键
                    onPositionChanged: {
                        parent.x = mouseX+parent.x-width/2
                    }
                }
            }
            Label {
                id:label_time
                text: qsTr("时间")
                anchors.right: ts2.left
                anchors.left: ts1.right
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts2
                x:240
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton //只处理鼠标左键
                    onPositionChanged: {
                        parent.x = mouseX+parent.x-width/2
                    }
                }
            }
            Label {
                id:label_aug
                text: qsTr("A:ug")
                anchors.left: ts2.right
                anchors.right: ts3.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts3
                x:ts2.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_aig
                text: qsTr("A:ig")
                anchors.left: ts3.right
                anchors.right: ts4.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts4
                x:ts3.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_ail
                text: qsTr("A:il")
                anchors.left: ts4.right
                anchors.right: ts5.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts5
                x:ts4.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_ausyn
                text: qsTr("A:usyn")
                anchors.left: ts5.right
                anchors.right: ts6.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts6
                x:ts5.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_augd
                text: qsTr("A:ugd")
                anchors.left: ts6.right
                anchors.right: ts7.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts7
                x:ts6.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_aigd
                text: qsTr("A:igd")
                anchors.left: ts7.right
                anchors.right: ts8.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts8
                x:ts7.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_auk
                text: qsTr("A:uk")
                anchors.left: ts8.right
                anchors.right: ts9.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts9
                x:ts8.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_ap
                text: qsTr("A:p")
                anchors.left: ts9.right
                anchors.right: ts10.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts10
                x:ts9.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_aq
                text: qsTr("A:q")
                anchors.left: ts10.right
                anchors.right: ts11.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts11
                x:ts10.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_af
                text: qsTr("A:f")
                anchors.left: ts11.right
                anchors.right: ts12.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts12
                x:ts11.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_aus
                text: qsTr("A:us")
                anchors.left: ts12.right
                anchors.right: ts13.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts13
                x:ts12.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bug
                text: qsTr("B:ug")
                anchors.left: ts13.right
                anchors.right: ts14.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts14
                x:ts13.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_big
                text: qsTr("B:ig")
                anchors.left: ts14.right
                anchors.right: ts15.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts15
                x:ts14.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bil
                text: qsTr("B:il")
                anchors.left: ts15.right
                anchors.right: ts16.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts16
                x:ts15.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_busyn
                text: qsTr("B:usyn")
                anchors.left: ts16.right
                anchors.right: ts17.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts17
                x:ts16.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bugd
                text: qsTr("B:ugd")
                anchors.left: ts17.right
                anchors.right: ts18.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts18
                x:ts17.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bigd
                text: qsTr("B:igd")
                anchors.left: ts18.right
                anchors.right: ts19.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts19
                x:ts18.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_buk
                text: qsTr("B:uk")
                anchors.left: ts19.right
                anchors.right: ts20.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts20
                x:ts19.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bp
                text: qsTr("B:p")
                anchors.left: ts20.right
                anchors.right: ts21.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts21
                x:ts20.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bq
                text: qsTr("B:q")
                anchors.left: ts21.right
                anchors.right: ts22.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts22
                x:ts21.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bf
                text: qsTr("B:f")
                anchors.left: ts22.right
                anchors.right: ts23.left
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
            ToolSeparator {
                id:ts23
                x:ts22.x+parent.tsInterval
                height: parent.height
                MouseArea{
                    height: parent.height
                    anchors.leftMargin: -width/2+parent.width/2
                    width: 50
                    anchors.left: parent.left
                    acceptedButtons: Qt.LeftButton
                    onPositionChanged: {parent.x = mouseX+parent.x-width/2}
                }
            }
            Label {
                id:label_bus
                text: qsTr("B:us")
                anchors.left: ts23.right
                anchors.right: parent.right
                font.bold: true
                font.family: "Times New Roman"
                font.pixelSize: parent.textSize
                anchors.verticalCenter: parent.verticalCenter
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                verticalAlignment: Qt.AlignVCenter
            }
        }

        ListView {
            id: p7t_listView
            clip: true
            width: flickable.contentWidth
//            keyNavigationWraps: true
            anchors.top: p7t_toobarHeader.bottom
            anchors.bottom: parent.bottom
            snapMode: ListView.SnapToItem
            focus: true

            ScrollBar.vertical: ScrollBar {
                width: 25
                active: true
                anchors.rightMargin: root.width>parent.width?-parent.width:-root.width-flickable.visibleArea.xPosition*parent.width
                anchors.right: parent.left
                parent: p7t_listView
                minimumSize: 0.2
            }

            model:ListModel{
                id:p7t_listView_model
//                ListElement {
//                    text_date: ""
//                }
            }

            delegate:Item {
                id: wrapper
                width: parent.width
                height: 30

                EXC_listViewItemDelegate1{
                    id: p7t_listViewItemdeleg_date
                    locationBase: label_date
                    mtext: text_date
                }
                EXC_listViewItemDelegate1{
                    id: p7t_listViewItemdeleg_time
                    locationBase: label_time
                    mtext: text_time
                }

                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Aug
                   locationBase: label_aug
                   mtext: text_aug
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Aig
                   locationBase: label_aig
                   mtext: text_aig
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Ail
                   locationBase: label_ail
                   mtext: text_ail
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Ausyn
                   locationBase: label_ausyn
                   mtext: text_ausyn
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Augd
                   locationBase: label_augd
                   mtext: text_augd
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Aigd
                   locationBase: label_aigd
                   mtext: text_aigd
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Auk
                   locationBase: label_auk
                   mtext: text_auk
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Ap
                   locationBase: label_ap
                   mtext: text_ap
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Aq
                   locationBase: label_aq
                   mtext: text_aq
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Af
                   locationBase: label_af
                   mtext: text_af
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Aus
                   locationBase: label_aus
                   mtext: text_aus
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bug
                   locationBase: label_bug
                   mtext: text_bug
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Big
                   locationBase: label_big
                   mtext: text_big
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bil
                   locationBase: label_bil
                   mtext: text_bil
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Busyn
                   locationBase: label_busyn
                   mtext: text_busyn
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bugd
                   locationBase: label_bugd
                   mtext: text_bugd
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bigd
                   locationBase: label_bigd
                   mtext: text_bigd
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Buk
                   locationBase: label_buk
                   mtext: text_buk
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bp
                   locationBase: label_bp
                   mtext: text_bp
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bq
                   locationBase: label_bq
                   mtext: text_bq
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bf
                   locationBase: label_bf
                   mtext: text_bf
               }
                EXC_listViewItemDelegate1{
                   id: p7t_listViewItemdeleg_Bus
                   locationBase: label_bus
                   mtext: text_bus
               }

                MouseArea {
                    id:mouseAreaThis
                    anchors.fill: parent
                    onClicked: p7t_listView.currentIndex = index
                    Rectangle{
                        anchors.fill: parent
                        border.width:1
                        border.color:wrapper.ListView.isCurrentItem?"lightskyblue":"transparent"

                        color:"transparent"
                    }
                }
            }
        }
    }

    Rectangle {
        id: rectangle
        width: parent.width*0.25
        height: parent.height*0.1
        color: funcMouse.containsMouse? "#4492dccd":"#2292dccd"
        radius: 7*root.minSize
        anchors.top: parent.top
        anchors.topMargin: parent.height*0.3
        anchors.horizontalCenter: parent.horizontalCenter
        scale: funcMouse.pressed?0.98:1
        Text {
            color: funcMouse.containsMouse?"#33df6060":"#11df6060"
            text: qsTr("双击菜单")
            font.family: "Verdana"
            font.pointSize: 30*root.minSize
            verticalAlignment: Text.AlignVCenter
            horizontalAlignment: Text.AlignHCenter
            anchors.fill: parent
        }
        MouseArea{
            id:funcMouse
            hoverEnabled: true
            anchors.fill: parent
            onClicked: {contentMenu.close()}
            onDoubleClicked: {contentMenu.open()}

            Menu { // 右键菜单
                //title: "Edit"
                id: contentMenu
                font.family: "Verdana"

                MenuItem {
                    text: qsTr("加载数据库")
                    onTriggered: {excRecordDisplayer.sl_selectDatabase()}
                }

                MenuItem {
                    text: qsTr("加载数据")
                    onTriggered: {p7t_listView_model.clear();excRecordDisplayer.sl_showLoadSettingUI(2);}

                    Timer{
                        interval: 800
                        repeat: true
                        triggeredOnStart: false
                        running: true
                        property int mdate: 0
                        onTriggered: parent.enabled = excRecordDisplayer.sl_isDatabaseOpen()
                    }
                }

                MenuItem {
                    text: qsTr("清除")
                    onTriggered: {
                        p7t_listView_model.clear()
                    }
                }

                MenuSeparator { }

                MenuItem {
                    text: qsTr("全屏")
                    onTriggered: {excRecordDisplayer.sl_fullScreen()}
                }


                MenuItem {
                    text: qsTr("切换到图表界面")
                    onTriggered: {
                        root.parent.parent.currentIndex = 0
                    }
                }


                MenuItem {
                    text: qsTr("无动作")
                }
            }
        }
    }

    BusyIndicator {
        id: busyIndicator
        width: 100
        height: 100
        running: false
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        Text {
            id: busyIndicator_value
            property real value: 0
            text: value.toFixed(2)+"%"
            font.pointSize: 13
            verticalAlignment: Text.AlignVCenter
            horizontalAlignment: Text.AlignHCenter
            anchors.fill: parent
            visible: false
        }
    }

    function setBusyIndicator(sorn){busyIndicator.running = sorn; busyIndicator_value.visible = sorn;}
    function setBusyIndicatorValue(value){busyIndicator_value.value = value}


//    Component.onCompleted: {
//        addModelString("","","","","","","","","","","","","","","","","","","","","","","","","");
//        for(var i=0; i<20; i++)
//            addModelNum(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24)
//        //                clearModel()
//    }
    function addModelNum(data, time, aug, aig, ail, ausyn, augd, aigd, auk, ap, aq, af, aus, bug, big, bil, busyn, bugd, bigd, buk, bp, bq, bf, bus)
    {
        p7t_listView_model.insert(0,
                                  {
                                      "text_date":String(data),
                                      "text_time":String(time),
                                      "text_aug":String(aug),
                                      "text_aig":String(aig),
                                      "text_ail":String(ail),
                                      "text_ausyn":String(ausyn),
                                      "text_augd":String(augd),
                                      "text_aigd":String(aigd),
                                      "text_auk":String(auk),
                                      "text_ap":String(ap),
                                      "text_aq":String(aq),
                                      "text_af":String(af),
                                      "text_aus":String(aus),
                                      "text_bug":String(bug),
                                      "text_big":String(big),
                                      "text_bil":String(bil),
                                      "text_busyn":String(busyn),
                                      "text_bugd":String(bugd),
                                      "text_bigd":String(bigd),
                                      "text_buk":String(buk),
                                      "text_bp":String(bp),
                                      "text_bq":String(bq),
                                      "text_bf":String(bf),
                                      "text_bus":String(bus)
                                  })
    }

    function addModelString(data, time, aug, aig, ail, ausyn, augd, aigd, auk, ap, aq, af, aus, bug, big, bil, busyn, bugd, bigd, buk, bp, bq, bf, bus)
    {
        p7t_listView_model.insert(0,
                                  {
                                      "text_date":data,
                                      "text_time":time,
                                      "text_aug":aug,
                                      "text_aig":aig,
                                      "text_ail":ail,
                                      "text_ausyn":ausyn,
                                      "text_augd":augd,
                                      "text_aigd":aigd,
                                      "text_auk":auk,
                                      "text_ap":ap,
                                      "text_aq":aq,
                                      "text_af":af,
                                      "text_aus":aus,
                                      "text_bug":bug,
                                      "text_big":big,
                                      "text_bil":bil,
                                      "text_busyn":busyn,
                                      "text_bugd":bugd,
                                      "text_bigd":bigd,
                                      "text_buk":buk,
                                      "text_bp":bp,
                                      "text_bq":bq,
                                      "text_bf":bf,
                                      "text_bus":bus
                                  })
    }

    function addModelMix(data, time, aug, aig, ail, ausyn, augd, aigd, auk, ap, aq, af, aus, bug, big, bil, busyn, bugd, bigd, buk, bp, bq, bf, bus)
    {
        p7t_listView_model.insert(0,
                                  {
                                      "text_date":data,
                                      "text_time":time,
                                      "text_aug":String(aug),
                                      "text_aig":String(aig),
                                      "text_aug":String(aug),
                                      "text_aig":String(aig),
                                      "text_ail":String(ail),
                                      "text_ausyn":String(ausyn),
                                      "text_augd":String(augd),
                                      "text_aigd":String(aigd),
                                      "text_auk":String(auk),
                                      "text_ap":String(ap),
                                      "text_aq":String(aq),
                                      "text_af":String(af),
                                      "text_aus":String(aus),
                                      "text_bug":String(bug),
                                      "text_big":String(big),
                                      "text_bil":String(bil),
                                      "text_busyn":String(busyn),
                                      "text_bugd":String(bugd),
                                      "text_bigd":String(bigd),
                                      "text_buk":String(buk),
                                      "text_bp":String(bp),
                                      "text_bq":String(bq),
                                      "text_bf":String(bf),
                                      "text_bus":String(bus)
                                  })
    }

    function addModelFromC(dateTime, vec)
    {
        addModelMix(dateTime.toLocaleString(Qt.locale(), "yyyy-MM-dd"),
                    dateTime.toLocaleString(Qt.locale(), "hh:mm:ss.zzz"),
                    vec[0]/100,
                    vec[1]/100,
                    vec[2]/100,
                    vec[3]/100,
                    vec[4]/100,
                    vec[5]/100,
                    vec[6]*180/10000,
                    vec[7]/100,
                    vec[8]/100,
                    vec[9]/100,
                    vec[10]/100,
                    vec[11]/100,
                    vec[12]/100,
                    vec[13]/100,
                    vec[14]/100,
                    vec[15]/100,
                    vec[16]/100,
                    vec[17]*180/10000,
                    vec[18]/100,
                    vec[19]/100,
                    vec[20]/100,
                    vec[21]/100)

    }

    function addModelFromCOnlyA(dateTime, vec)
    {
        addModelString(dateTime.toLocaleDateString(),
                       dateTime.toTimeString(),
                       String(vec[0]/100),
                       String(vec[1]/100),
                       String(vec[2]/100),
                       String(vec[3]/100),
                       String(vec[4]/100),
                       String(vec[5]/100),
                       String(vec[6]*180/10000),
                       String(vec[7]/100),
                       String(vec[8]/100),
                       String(vec[9]/100),
                       String(vec[10]/100),
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "")

    }
    function addModelFromCOnlyB(dateTime, vec)
    {
        addModelString(dateTime.toLocaleDateString(),
                       dateTime.toTimeString(),
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       "",
                       String(vec[0]/100),
                       String(vec[1]/100),
                       String(vec[2]/100),
                       String(vec[3]/100),
                       String(vec[4]/100),
                       String(vec[5]/100),
                       String(vec[6]*180/10000),
                       String(vec[7]/100),
                       String(vec[8]/100),
                       String(vec[9]/100),
                       String(vec[10]/100))

    }
}


